import 'package:get/get.dart';
import 'package:nft_shop/my/model/models.dart';
import 'package:nft_shop/net/service_repository.dart';
import 'package:nft_shop/res/constant.dart';

class MyInviteConteroller extends GetxController {

  static final String MyInviteID = 'MyInviteID';

  ///状态
  late int status = LoadStatusType.loading;

  late InviteFriendsModel model;

  static MyInviteConteroller get to => Get.find<MyInviteConteroller>();

  @override
  void onInit() {
    // TODO: implement onInit
    super.onInit();
    print("邀请好友执行中---");
    getData();
  }

  Future<void> getData() async {
    try{
      model = await ServiceRepository.inviteFriends();
      status = LoadStatusType.success;
    }catch(e,s){
      status = LoadStatusType.empty;
    }
    update([MyInviteID]);
  }

}